using System;
using Newtonsoft.Json;

namespace FBGraph.Models
{
    /// <summary>A photo album</summary>
    /// <remarks>
    /// <para>Example: https://graph.facebook.com/99394368305 (Coca-Cola fan page wall photos)</para>
    /// </remarks>
    public partial class Album : IFBGraphResult
    {
        /// <summary>The photo album ID</summary>
        [JsonPropertyAttribute("id")]
        public Int64 Id { get; set; }
        
        /// <summary>An object containing the ID and name of the profile who posted this album</summary>
        [JsonPropertyAttribute("from")]
        public From From { get; set; }
        
        /// <summary>The title of the album</summary>
        [JsonPropertyAttribute("name")]
        public String Name { get; set; }
        
        /// <summary>The location of the album</summary>
        [JsonPropertyAttribute("location")]
        public String Location { get; set; }
        
        /// <summary>A link to this album on Facebook</summary>
        [JsonPropertyAttribute("link")]
        public String Link { get; set; }
        
        /// <summary>The privacy setting for the album, which determines which users are allowed to view the <see cref="Album" /></summary>
        [JsonPropertyAttribute("privacy")]
        public String Privacy { get; set; }
        
        /// <summary>The number of photos in this album</summary>
        [JsonPropertyAttribute("count")]
        public Int64 Count { get; set; }
        
        /// <summary>The time the photo album was initially created</summary>
        [JsonPropertyAttribute("created_time")]
        public DateTime CreatedTime { get; set; }
        
        /// <summary>The last time the photo album was updated</summary>
        [JsonPropertyAttribute("updated_time")]
        public DateTime UpdatedTime { get; set; }
        
        /// <summary>The description of the album</summary>
        [JsonPropertyAttribute("description")]
        public String Description { get; set; }
        
        /// <summary>Gets or sets a <see cref="Boolean" /> value representing whether the object has been populated.</summary>
        Boolean IFBGraphResult.IsReady { get; set; }
        /// <summary>Updates the current model with values from another like-typed model.</summary>
        /// <param name="other">The source model.</param>
        /// <remarks>This is used for asynchronous calls to update the reference that was returned when the original API method was called.</remarks>
        void IFBGraphResult.UpdateFrom(IFBGraphResult other)
        {
            var that = other as Album;
            if (that == null) return;
            else
            {
                this.Id = that.Id;
                this.From = that.From;
                this.Name = that.Name;
                this.Location = that.Location;
                this.Link = that.Link;
                this.Privacy = that.Privacy;
                this.Count = that.Count;
                this.CreatedTime = that.CreatedTime;
                this.UpdatedTime = that.UpdatedTime;
                this.Description = that.Description;
                ((IFBGraphResult)this).IsReady = true;
            }
            
        }
    }
}